#ifndef WIDGET_H
#define WIDGET_H

#include <QtCore/QDebug>

#include <QtGui/QWidget>
#include <QtGui/QFormLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QTextEdit>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QComboBox>
#include <QtGui/QSplitter>
#include <QtGui/QPushButton>
#include <QtGui/QMessageBox>

#include <PortSIPLib/PortSIPLib.hxx>
#include <PortSIPLib/PortSIPErrors.hxx>
#include <PortSIPLib/ICallbackParameters.hxx>
#include <PortSIPLib/AbstractCallbackDispatcher.hxx>

#define SIPPORT_MIN	5000

using namespace PortSIP;

class Widget : public QWidget, public AbstractCallbackDispatcher
{
    Q_OBJECT

public:
    Widget(QWidget *parent = 0);
    ~Widget();

    void onMessage(void * parameters);
        static void * m_SIPLib;

public slots:
    void button1Click();

private:
    QLineEdit* lineEdit1;
    QLineEdit* lineEdit2;
    QLineEdit* lineEdit3;
    QLineEdit* lineEdit4;

    QPushButton* button1;
    QPushButton* button2;

    QComboBox* combobox1;
    QComboBox* combobox2;
    QComboBox* combobox3;

    void initComponents();
    void initPortSIP();
    void loadDevices();
    void setSRTPType();
    void updateAudioCodecs();
    void updateVideoCodecs();
    void initSettings();
    void setVideoResolution();
    void setVideoBitrate();


    bool sipInitialized;
    bool sipRegistered;

    bool m_PCMU;
    bool m_PCMA;
    bool m_G729;
    bool m_ILBC;
    bool m_GSM;
    bool m_G722;
    bool m_SPEEX;
    bool m_SPEEX_WB;
    bool m_H263;
    bool m_H2631998;
    bool m_H264;
    bool m_AEC;
    bool m_VAD;
    bool m_AGC;
    bool m_CNG;
    bool m_ANS;

    bool m_AMRWB;
    bool m_G7221;
    bool m_AMR;
    bool m_VP8;
    bool m_PRACK;

    bool m_Opus;

    bool m_DND;

};

#endif // WIDGET_H
